package com.company.book_store.web.servlet;
import com.alibaba.fastjson.JSON;
import com.company.book_store.pojo.User;
import com.company.book_store.service.Iuserservice;
import com.company.book_store.service.UserserviceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/updateUser")
public class updateUserInfo extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String account = req.getParameter("account");
        Iuserservice iuserservice = new UserserviceImpl();
        User user = iuserservice.selectByaccount(account);
        String jsonStr = JSON.toJSONString(user);
        PrintWriter out = resp.getWriter();
        out.write(jsonStr);
    }
}
